#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n;
const int N=1e5+5;
int a[N];
signed main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    int res=0;
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++){
        int j=i;
        while(j<n&&a[j+1]==a[i])++j;
        if(res>(j-i+1))res-=(j-i+1);
        else res=0;
        res+=(j-i+1);
        i=j;
    }
    printf("%d\n",res);
    return 0;
}